package cn.edu.stu.syllabus.oa.star;

import android.os.Bundle;

import javax.inject.Inject;

import cn.edu.stu.syllabus.R;
import cn.edu.stu.syllabus.base.BaseActivity;
import cn.edu.stu.syllabus.utils.ActivityUtils;
import cn.edu.stu.syllabus.utils.GuideHelper;

public class OaStarActivity extends BaseActivity {

    @Inject
    OaStarPresenter mOaStarPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_oa_star;
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setTitle("我的收藏");

        OaStarFragment oaStarFragment = (OaStarFragment) getSupportFragmentManager()
                .findFragmentById(R.id.contentFrame);
        if (oaStarFragment == null) {
            oaStarFragment = OaStarFragment.newInstance();
            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(), oaStarFragment,
                    R.id.contentFrame);
        }

        DaggerOaStarComponent.builder()
                .oaStarPresenterModule(new OaStarPresenterModule(oaStarFragment))
                .build().inject(this);


        GuideHelper.startActSeqNow(this,
                GuideHelper.getActMainTapTarget(R.drawable.ic_favorite, this,
                        "这是收藏夹界面",
                        "如果你需要取消某个收藏，可以长按item并点击取消。\n" +
                                "底部上拉可以加载更多\n双击Title可以立刻回到顶部")
                        .id(1)
        );
    }
}
